<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div></div>
		<script type="text/javascript">
			/*
		      模板字符串:对字符串的增强，用反引号``
		      1.可以插入变量和表达式
			  2.可以调用函数
			  3.换行和空格都会保留
		
		    */
			let name = "张三";
			let str = "my name is " + name;
			let str2 = `my name is ${name}`;
			// console.log(str2);
			let age = 20;

			function fn() {
				return "男";
			}

			let html = "<table><tr><td>" + name + "</td><td>" + age + "</td></tr></table>";
			let html2 = `<table>
			               <tr>
						     <td>${name}</td>
							 <td>${age + 1}</td>
							 <td>${fn()}</td>
						   </tr>
						</table>`;
			let div = document.querySelector("div");
			div.innerHTML = html2;
			console.log(html2);
		</script>
	</body>
</html>
